﻿/*
 * 低级错误 ！= ==
 */
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

public class PlayerAttrStrategy : IAttrStrategy 
{
    public override void InitAttr(ICharactorAttr theCharactorAttr)
    {
        PlayerAttr theAttr = theCharactorAttr as PlayerAttr;
        Debug.Log(theAttr);
        if (theAttr == null)
        {
            return;
        }
        

        int addHp = 0;
        int LV = theAttr.GetLevel();
        if (LV > 0)
        {
            addHp = (LV - 1) * 2;
        }

        theAttr.AddMaxHp(addHp);
        theAttr.Init(20);
    }

    public override int GetAtkplusValue(ICharactorAttr theCharactorAttr)
    {
        return 0;
    }

    public override int GetDmgDesValue(ICharactorAttr theCharactorAttr)
    {
        PlayerAttr theAttr = theCharactorAttr as PlayerAttr;
        if (theAttr == null)
        {
            return 0;
        }

        return (theAttr.GetLevel() - 1) * 2;
    }
}
